﻿
#pragma once

#include "spdlog/spdlog.h"
#include "spdlog/fmt/bin_to_hex.h"

#define JSON_NOEXCEPTION
#include "json.hpp"
using namespace nlohmann;

#include "utils.hh"

#include "hv/hv.h"
#include "hv/hbase.h"
#include "hv/hplatform.h"
#include "hv/hendian.h"
#include "hv/base64.h"
#include "hv/hloop.h"
#include "hv/hthread.h"
#include "hv/mqtt_client.h"

#include "mqtt_msg.h"


#define E_SGW_OK               200
#define E_SGW_CUSTOM           1000
#define E_SGW_INVAILD_DATA     2000, "invaild data."
#define E_SGW_TRANSACTION_BUSY 2001, "sgw transaction busy."
#define E_SGW_UPGRADE_FILE     2002, "error upgrade file."
#define E_SGW_DOWNLOAD_FAILED  2003, "http download failed."
#define E_SGW_NOT_RESPONSE     2004, "sgw not response."

#define SGW_SERVICE_STARTED "--{:>6}: The {} service was started successfully."
#define SGW_SERVICE_STOPPED "--{:>6}: The {} service was stopped successfully."

std::string config_get_str(const char* section, const char* key);
int         config_get_int(const char* section, const char* key);

